<?php

namespace App\Http\Controllers\Vue;

use App\Http\Controllers\Controller;
use Jinxing\Admin\Repositories\Slide\SlideRepository;

/**
 * Class SlidesController 幻灯片
 *
 * @package App\Http\Controllers\Vue
 */
class SlidesController extends Controller
{
    /**
     * @var SlideRepository
     */
    private $slideRepository;

    public function __construct(SlideRepository $slideRepository)
    {
        $this->slideRepository = $slideRepository;
    }

    public function index()
    {
        return $this->success($this->slideRepository->findAll([
            'type_id' => request()->get('type_id'),
            'status'  => 1,
            'order'   => 'sort asc,id asc',
        ], ['id', 'title', 'image', 'url', 'target']));
    }
}
